<?php
namespace app\before\validate;

use think\Validate;

class Nearby extends Validate
{
    protected $rule = [
        'user_id' => 'require|number',
        'video' => 'require',
        'title' => 'require',
        'collect_num' => 'require|number',
        'zan_num' => 'require|number',
        'status' => 'require',
        'add_time' => 'require|number',
    ];
    protected $message = [
        'user_id.require' => '发布人ID为必填项',
        'user_id.number' => '发布人ID需为数字',
        'video.require' => '视频为必填项',
        'title.require' => '文字描述为必填项',
        'collect_num.require' => '收藏量为必填项',
        'collect_num.number' => '收藏量需为数字',
        'zan_num.require' => '点赞量为必填项',
        'zan_num.number' => '点赞量需为数字',
        'status.require' => '状态 1：正常 0：删除为必填项',
        'add_time.require' => '发布时间为必填项',
        'add_time.number' => '发布时间需为数字',
    ];
    protected $scene = [
        'edit' => [
            'user_id',
            'video',
            'title',
            'collect_num',
            'zan_num',
            'status',
            'add_time',
        ],
    ];
}
